//============================================================================
// Name        : mang1chieucontro.cpp
// Author      :
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

#include "khaibao.h"
int menu()
{
	int cv;
	do{
		cout<<"\n\n================================================\n";
		cout<<"\n1.xoa tat cac cac phan tu trung x trong mang so nguyen";
		cout<<"\n2.xoa mot chuoi ky tu con trong chuoi ky tu";
		cout<<"\n3.tinh de quy T(x,n)=x^n";
		cout<<"\n4.tra ve tong gia tri cac phan tu co chu so hang chuc la 5 nam tren bien ma tran";
		cout<<"\n5.kiem tra mang a co phai la con cua mang b khong?";
		cout<<"\nmoi ban chon cong viec: ";
		cin>>cv;
	}while(cv<0);
	return cv;
}
int main() {
	int d=4, y, z,w,e;
	y = --d;
	z=d--;
	w=d++;
	e=++d;
	cout<< "\nd="<<d<< "\ny="<<y<< "\nz="<<z<< "\nw="<<w<< "\ne="<<e ;
	int a=A(50);
	if(a==1)
	{
		cout<<"co so 5";
	}
	else{
		cout<<"khong co so 5";
	}
	int cv,n,m,x,*p,*q,**k;
	char str1[30]="nguyen cao cuong",str2[10]="uo";
	do{
		cv=menu();
		switch(cv)
		{
		case 1:
			cout<<"\nBAI 1:xoa phan tu trung voi x trong mang a:\nmoi ban nhap so pt mang a:";
			cin>>n;
			p=new int [n];
			nhap(p,n);
			xuat(p,n);
			cout<<"\nnhap x:";
			cin>>x;
			xoa(p,n,x);
			xuat(p,n);
			break;
		case 2:
			xoachuoi(str1,str2);
			cout<<endl<<str1;
			break;
		case 3:
			cout<<"\nBAI 3: de quy T(x,n)=x^n:";
			cout<<"\nnhap x:";
			cin>>x;
			cout<<"nhap n:";
			cin>>n;
			cout<<"ket qua: "<<tinh(x,n);
			break;
		case 4:
			cout<<"\nBAI 4:tong cac pt co chu so hang chuc la 5 tren bien.";
			cout<<"\nnhap dong:";
			cin>>n;
			cout<<"nhap cot:";
			cin>>m;
			k=new int*[n];
			nhapmt(k,n,m);
			xuatmt(k,n,m);
			cout<<"\ncac phan tu:";
			bienmatran(k,n,m);
			break;
		case 5:
			cout<<"\nBAI 5:mang a co phai la con mang b khong?\nnhap so pt mang a:";
			cin>>n;
			p=new int [n];
			nhap(p,n);
			xuat(p,n);
			cout<<"\nnhap so pt mang b:";
			cin>>m;
			q=new int [m];
			nhap(q,m);
			xuat(q,m);
			if(kiemtra(p,q,n,m)==1)
			{
				cout<<"\na con b";
			}
			else
			{
				cout<<"\na khong la con b.";
			}
			break;
		case 0:
			cout<<"\nda thoat.";
			break;
		default:
			cout<<"\nkhong co cong viec nay.";
			break;
		}
	}while(cv!=0);
	return 0;
}
